Skip to content

Reduce unnecessary match image rendering#319

Merged
JasonWildMe merged 5 commits into
mainfrom
optimize-renders
Apr 1, 2026
Merged

Reduce unnecessary match image rendering#319
JasonWildMe merged 5 commits into
mainfrom
optimize-renders

Conversation

@JasonWildMe
Copy link
Copy Markdown
Contributor

Summary

  • Reduce top-N rendered matches from 20 to 12, matching Wildbook's RESMAX_DEFAULT = 12 — no point rendering images Wildbook never displays
  • Filter out zero-score matches before rendering, avoiding wasted work on non-matches

Context

Wildbook's iaResults.jsp only requests up to 12 results and only fetches the heatmask version. WBIA was rendering 3 image types × 20 annotations = up to 60 images per query, when at most 12 are ever used.

Test plan

  • Run an ID job and verify results still display correctly in Wildbook
  • Confirm rendered image count is reduced (check _ibsdb/_wbia_cache/ directory)

🤖 Generated with Claude Code

JasonWildMe and others added 5 commits March 28, 2026 09:59
Change top-N from 20 to 12 to match Wildbook's RESMAX_DEFAULT, and
filter out zero-score matches before rendering. This avoids rendering
images that Wildbook will never display.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wildbook only requests heatmask images. The matches (SIFT feature
overlay) and clean render types were never displayed. Removing them
cuts per-job rendering from 3 images to 1 per match annotation,
reducing a 200-job bulk import from ~100 minutes to ~33 minutes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of synchronously rendering heatmask images for every match
before returning the job result, defer rendering to the /match/thumb/
endpoint. When a user clicks "inspect" in Wildbook, the endpoint
renders the side-by-side chip image on first request and caches it
for subsequent requests.

This decouples image rendering from the identification pipeline,
allowing the callback to Wildbook to fire immediately after inference
completes instead of blocking for 30-90s of image I/O.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The zero-score filter could empty the candidate list on queries with
no positive matches, causing downstream assertion failures. Fall back
to the single best-ranked result so Wildbook always has at least one
candidate to display.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HotSpotter's yellow heatmask overlay requires the ChipMatch spatial
data which is only available during query_chips_graph. Render
synchronously for HotSpotter (proot=vsmany) to preserve the overlay.
MiewID, PIE, and other algorithms continue to use on-demand rendering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JasonWildMe JasonWildMe requested a review from LashaO April 1, 2026 00:23
@JasonWildMe JasonWildMe self-assigned this Apr 1, 2026
@JasonWildMe JasonWildMe merged commit d774ee1 into main Apr 1, 2026
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant